package com.tdkj.model.user;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.tdkj.model.base.BaseEntity;

/**
 * XnkyAdminLevel entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "xnky_admin_level")
public class BeanAdminLevel extends BaseEntity{
	private static final long serialVersionUID = 8562201576584661260L;
	// Fields
	private String levelcode;
	private String levelname;
	private Set<BeanAdmin> admins = new HashSet<BeanAdmin>(0);
	
	private BeanPermission permission;

	// Constructors

	/** default constructor */
	public BeanAdminLevel() {
	}

	/** full constructor */
	public BeanAdminLevel(long id,String levelcode, String levelname,Set<BeanAdmin> admins) {
		this.setId(id);
		this.levelcode = levelcode;
		this.levelname = levelname;
		this.admins=admins;
	}

	@Column(name = "levelcode", length = 40)
	public String getLevelcode() {
		return this.levelcode;
	}

	public void setLevelcode(String levelcode) {
		this.levelcode = levelcode;
	}

	@Column(name = "levelname", length = 40)
	public String getLevelname() {
		return this.levelname;
	}

	public void setLevelname(String levelname) {
		this.levelname = levelname;
	}
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "adminLevel")
	public Set<BeanAdmin> getAdmins() {
		return this.admins;
	}

	public void setAdmins(Set<BeanAdmin> admins) {
		this.admins = admins;
	}
   @OneToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY)
	public BeanPermission getPermission() {
		return permission;
	}

	public void setPermission(BeanPermission permission) {
		this.permission = permission;
	}

}